<?php
# PMB Online
# Aplikasi PMB Online untuk Pendaftaran Calon Mahasiswa di PT/PTS Indonesia
# 
# version 1.0
# class daftar
# file
# created Jan 19, 2013 9:06:55 PM
# 
# (c)2012, arif.laksito@gmail.com

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
?>

<script>
    $(function() {
        $( "#datepicker" ).datepicker({
            changeMonth: true,
            changeYear: true,
            yearRange: "c-60:c+0",
            dateFormat: "yy-mm-dd"
        });
    });
</script>

<?php if (isset($msg)): ?>
    <div class="<?php echo ($sts) ? 'alert alert-success' : 'alert alert-error' ?>">
        <?php echo $msg ?>
    </div>
<?php endif ?>

<form action="" method="post" class="ins">
    <div class="row">
        <div class="span6">        
            <legend>Data Pendaftar</legend>            

            <label>Jenis Pendaftaran</label>
            <label class="radio"> 
                <input type="radio" name="status_daftar" value="0" <?php if ($post['status_daftar'] == 0) echo "checked='checked'" ?>/> Reguler <br />
                <input type="radio" name="status_daftar" value="1" <?php if ($post['status_daftar'] == 1) echo "checked='checked'" ?>/> Pindahan
            </label>

            <label>Pilihan D3</label>            
            <select name="jur_d3">
                <option value="">Pilih Jurusan D3..</option>
                <?php foreach ($d3 as $d): ?>      
                    <?php $c = ($post['jur_d3']==$d['jenjang'] . '-' . $d['nama_jurusan'])?"selected='selected'":''?>
                    <option <?php echo $c?> value="<?php echo $d['jenjang'] . '-' . $d['nama_jurusan'] ?>"> 
                        <?php echo $d['jenjang'] . '-' . $d['nama_jurusan'] ?>
                    </option>
                <?php endforeach ?>     
            </select>            

            <label>Pilihan S1</label>
            <select name="jur_s1">
                <option value="">Pilih Jurusan S1..</option>
                <?php foreach ($s1 as $s): ?>
                    <?php $d = ($post['jur_s1']==$s['jenjang'] . '-' . $s['nama_jurusan'])?"selected='selected'":''?>
                    <option <?php echo $d?> value="<?php echo $s['jenjang'] . '-' . $s['nama_jurusan'] ?>">
                        <?php echo $s['jenjang'] . '-' . $s['nama_jurusan'] ?>
                    </option>    
                <?php endforeach ?>            
            </select>

            <legend>Data Pribadi</legend>            
            <label>Nama Lengkap*</label>
            <input type="text" name="nama_lengkap" value="<?php echo $post['nama_lengkap'] ?>" class="input-xlarge"/>

            <label>Tempat/Tgl Lahir*</label>
            <input type="text" name="tempat_lahir" value="<?php echo $post['tempat_lahir'] ?>"/>
            <input type="text" id="datepicker" class="input-small" name="tgl_lahir" value="<?php echo $post['tgl_lahir'] ?>"/> 

            <label>Jenis Kelamin</label>
            <label class="radio">
                <?php foreach ($jkel as $k => $jk): ?>
                    <input type="radio" name="jkel" value="<?php echo $k ?>" <?php echo ($post['jkel'] == $k) ? "checked='checked'" : "" ?>/> <?php echo $jk ?> <br />
                <?php endforeach ?>                
            </label>
            <label>Agama</label>
            <select name="agama">
                <?php foreach ($agm as $a => $ag): ?>
                    <option value="<?php echo $a ?>" <?php echo ($post['agama'] == $a) ? "selected='selected'" : "" ?>><?php echo $ag ?></option>
                <?php endforeach ?>                
            </select>

            <label>Status Pernikahan</label>
            <label class="radio">
                <input type="radio" name="status_nikah" value="0" <?php echo ($post['status_nikah'] == 0) ? "checked='checked'" : "" ?>/> Belum menikah <br />
                <input type="radio" name="status_nikah" value="1" <?php echo ($post['status_nikah'] == 1) ? "checked='checked'" : "" ?>/> Menikah
            </label>

            <label>Alamat Asal</label>
            <textarea name="alamat_asal" rows="3"><?php echo $post['alamat_asal'] ?></textarea>  
            
            <label>Kecamatan Asal</label>
            <input type="text" name="kec_asal" value="<?php echo $post['kec_asal']?>" />
            
            <label>Kota/Kab Asal</label>
            <input type="text" name="kota_asal" value="<?php echo $post['kota_asal']?>" />
            
            <label>Provinsi Asal</label>
            <input type="text" name="prov_asal" value="<?php echo $post['prov_asal']?>" />

            <label>Kode Pos Asal</label>
            <input type="text" class="input-small" name="kodepos_asal" value="<?php echo $post['kodepos_asal'] ?>"/>

            <label>Alamat Tempat Tinggal</label>
            <textarea name="alamat" rows="3"><?php echo $post['alamat'] ?></textarea>            

            <label>Kecamatan Tempat Tinggal</label>
            <input type="text" name="kec" value="<?php echo $post['kec']?>" />
            
            <label>Kota/Kab Tempat Tinggal</label>
            <input type="text" name="kota" value="<?php echo $post['kota']?>" />
            
            <label>Provinsi Tempat Tinggal</label>
            <input type="text" name="prov" value="<?php echo $post['prov']?>" />
            
            <label>Kode Pos Tempat Tinggal</label>
            <input type="text" class="input-small" name="kodepos" value="<?php echo $post['kodepos'] ?>"/>

            <label>No.Telp/HP <small>(format angka tanpa spasi dan tanda baca lain)</small></label>
            <input type="text" name="telp" value="<?php echo $post['telp'] ?>"/>            

            <label>Alamat Email</label>
            <input type="text" name="email" class="input-xlarge" value="<?php echo $post['email'] ?>"/>
        </div>
        <div class="span5">
            <legend>Data Orang Tua</legend>
            <label>Nama Ayah</label>
            <input type="text" name="nama_ayah" class="input-large" value="<?php echo $post['nama_ayah'] ?>"/>

            <label>Nama Ibu</label>
            <input type="text" name="nama_ibu" class="input-large" value="<?php echo $post['nama_ibu'] ?>"/>

            <label>Alamat Orang Tua</label>
            <textarea name="alamat_ortu" rows="3"><?php echo $post['alamat_ortu'] ?></textarea>            
            
            <label>Kecamatan Orang Tua</label>
            <input type="text" name="kec_ortu" value="<?php echo $post['kec_ortu']?>" />
            
            <label>Kota/Kab Orang Tua</label>
            <input type="text" name="kota_ortu" value="<?php echo $post['kota_ortu']?>" />
            
            <label>Provinsi Orang Tua</label>
            <input type="text" name="prov_ortu" value="<?php echo $post['prov_ortu']?>" />

            <label>Kode Pos Orang Tua</label>
            <input type="text" class="input-small" name="kodepos_ortu" value="<?php echo $post['kodepos_ortu'] ?>"/>

            <label>No.Telp/HP Orang Tua<br /><small>(format angka tanpa spasi dan tanda baca lain)</small></label>
            <input type="text" name="telp_ortu" value="<?php echo $post['telp_ortu'] ?>"/>                        

            <label>Pekerjaan Orang Tua</label>
            <select name="pekerjaan">
                <option value="">Pilih Pekerjaan Orang Tua..</option>
                <option value="PNS" <?php echo ($post['pekerjaan']=='PNS')?"selected='selected'":''?>>PNS</option>
                <option value="TNI/POLRI" <?php echo ($post['pekerjaan']=='TNI/POLRI')?"selected='selected'":''?>>TNI/POLRI</option>
                <option value="Wiraswasta" <?php echo ($post['pekerjaan']=='Wiraswasta')?"selected='selected'":''?>>Wiraswasta</option>
                <option value="Peg.Swasta" <?php echo ($post['pekerjaan']=='Peg.Swasta')?"selected='selected'":''?>>Peg.Swasta</option>
                <option value="Petani" <?php echo ($post['pekerjaan']=='Petani')?"selected='selected'":''?>>Petani</option>
                <option value="Pensiunan" <?php echo ($post['pekerjaan']=='Pensiunan')?"selected='selected'":''?>>Pensiunan</option>
                <option value="Lainnya" <?php echo ($post['pekerjaan']=='Lainnya')?"selected='selected'":''?>>Lainnya</option>
            </select>

            <legend>Data Asal Sekolah</legend>
            <label>Nama Sekolah/PT</label>
            <input type="text" class="input-xlarge" name="sekolah_asal" value="<?php echo $post['sekolah_asal'] ?>"/>

            <label>Tahun Lulus</label>
            <input type="text" class="input-small" name="th_lulus" value="<?php echo $post['th_lulus'] ?>"/>
            
            <label>Rata-rata NEM/IPK</label>
            <input type="text" class="input-small" name="nem" value="<?php echo $post['nem'] ?>"/>

            <label>Jurusan Sekolah</label>
            <select name="jurusan">
                <option value="">Pilih Jurusan Sekolah</option>
                <option value="IPA" <?php if($post['jurusan']=='IPA') echo "selected='selected'"?>>IPA</option>
                <option value="IPS" <?php if($post['jurusan']=='IPS') echo "selected='selected'"?>>IPS</option>
                <option value="Bahasa" <?php if($post['jurusan']=='Bahasa') echo "selected='selected'"?>>Bahasa</option>
                <option value="Lainnya" <?php if($post['jurusan']=='Lainnya') echo "selected='selected'"?>>Lainnya</option>
            </select> 

            <label>Alamat Sekolah/PT <small>(ditulis lengkap)</small></label>
            <textarea name="alamat_sekolah" rows="3"><?php echo $post['alamat_sekolah'] ?></textarea>  
            
            <label>Kota/Kab Sekolah/PT</label>
            <input type="text" name="kota_sekolah" value="<?php echo $post['kota_sekolah']?>" />
            
            <label>Provinsi Sekolah/PT</label>
            <input type="text" name="prov_sekolah" value="<?php echo $post['prov_sekolah']?>" />

            <label>Nama Kepala Sekolah/PT</label>
            <input type="text" class="input-xlarge" name="nama_kep_sek" value="<?php echo $post['nama_kep_sek'] ?>"/>

            <?php $info = array('Brosur','Internet','Teman/Saudara','Lainnya')?>            
            <label>Informasi Pendaftaran dari</label>
            <label class="checkbox">
                <?php foreach($info as $if):?>
                <?php $c = (isset($post['info']) && in_array($if, $post['info']))?"checked='checked'":''?>
                <input type="checkbox" name="info[]" <?php echo $c?> value="<?php echo $if?>"/> <?php echo $if?> <br />
                <?php endforeach?>                
            </label> 

            <small>Field dengan tanda * wajib diisikan</small>

            <br /><br />
            <button type="submit" class="btn btn-primary"><i class="icon-file"></i> Simpan Data</button>  

        </div>
    </div>    
</form>    
